/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * GUILoanType.java
 *
 * Created on Oct 13, 2011, 9:16:46 AM
 */
package gui;

import Config.Localization;
import com.sun.java.swing.SwingUtilities3;
import entities.LoanType;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import bl.BLLoanType;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author Bich Tran Van
 */
public class GUILoanType extends javax.swing.JPanel {

    private ArrayList<LoanType> loanTypes = null;
    private BLLoanType blLoanType = null;
    private LoanType loanType = null;

    /** Creates new form GUILoanType */
    public GUILoanType() {

        initComponents();
        loanTypes = new ArrayList<LoanType>();
        blLoanType = new BLLoanType();
        loadLoanType();

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pnlForm = new javax.swing.JPanel();
        btnNew = new javax.swing.JButton();
        btnAdd = new javax.swing.JButton();
        btnEdit = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        txtInterestRate = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        txtTypeOfLoan = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        lblLoanTypeID = new javax.swing.JLabel();
        pnlTable = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tblLoanType = new javax.swing.JTable();
        pnlControl = new javax.swing.JPanel();
        btnlist = new javax.swing.JButton();
        txtSearch = new javax.swing.JTextField();
        cboSearch = new javax.swing.JComboBox();
        btnSearch = new javax.swing.JButton();
        btnDisable = new javax.swing.JButton();

        setAlignmentX(0.0F);
        setAlignmentY(0.0F);
        setAutoscrolls(true);
        setPreferredSize(new java.awt.Dimension(800, 500));

        pnlForm.setPreferredSize(new java.awt.Dimension(826, 176));

        btnNew.setFont(new java.awt.Font("Tahoma", 0, 12));
        btnNew.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icon/new.png"))); // NOI18N
        btnNew.setText("Create new");
        btnNew.setAlignmentY(0.0F);
        btnNew.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        btnNew.setMaximumSize(new java.awt.Dimension(100, 25));
        btnNew.setMinimumSize(new java.awt.Dimension(100, 25));
        btnNew.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNewActionPerformed(evt);
            }
        });

        btnAdd.setFont(new java.awt.Font("Tahoma", 0, 12));
        btnAdd.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/add_small.png"))); // NOI18N
        btnAdd.setText("Add");
        btnAdd.setAlignmentY(0.0F);
        btnAdd.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAddActionPerformed(evt);
            }
        });

        btnEdit.setFont(new java.awt.Font("Tahoma", 0, 12));
        btnEdit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/Text-Edit-icon.png"))); // NOI18N
        btnEdit.setText("Edit");
        btnEdit.setAlignmentY(0.0F);
        btnEdit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEditActionPerformed(evt);
            }
        });

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        jLabel2.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel2.setText("Interest rate");

        txtInterestRate.setFont(new java.awt.Font("Tahoma", 0, 12));

        jLabel4.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel4.setForeground(new java.awt.Color(255, 0, 0));
        jLabel4.setText("*");

        jLabel5.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel5.setForeground(new java.awt.Color(255, 0, 0));
        jLabel5.setText("*");

        jLabel3.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel3.setText("Loan type ID");

        txtTypeOfLoan.setFont(new java.awt.Font("Tahoma", 0, 12));

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel1.setText("Type of  loan");

        lblLoanTypeID.setFont(new java.awt.Font("Tahoma", 0, 12));

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addGap(40, 40, 40)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2)
                    .addComponent(jLabel3)
                    .addComponent(jLabel1))
                .addGap(27, 27, 27)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtTypeOfLoan, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE)
                            .addComponent(txtInterestRate, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel4)
                            .addComponent(jLabel5)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(lblLoanTypeID)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 138, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(23, 23, 23))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(lblLoanTypeID))
                .addGap(17, 17, 17)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(txtTypeOfLoan, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel4)))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtInterestRate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2)
                    .addComponent(jLabel5))
                .addContainerGap(22, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout pnlFormLayout = new javax.swing.GroupLayout(pnlForm);
        pnlForm.setLayout(pnlFormLayout);
        pnlFormLayout.setHorizontalGroup(
            pnlFormLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlFormLayout.createSequentialGroup()
                .addGap(122, 122, 122)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(64, 64, 64)
                .addGroup(pnlFormLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(btnNew, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnEdit, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnAdd, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(172, Short.MAX_VALUE))
        );
        pnlFormLayout.setVerticalGroup(
            pnlFormLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlFormLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlFormLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(pnlFormLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(btnNew, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(17, 17, 17)
                        .addComponent(btnAdd)
                        .addGap(18, 18, 18)
                        .addComponent(btnEdit)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 18, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(9, 9, 9))
        );

        pnlTable.setAlignmentX(0.0F);
        pnlTable.setAlignmentY(0.0F);
        pnlTable.setPreferredSize(new java.awt.Dimension(800, 201));

        tblLoanType.setAutoCreateRowSorter(true);
        tblLoanType.setFont(new java.awt.Font("Tahoma", 0, 12));
        tblLoanType.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        tblLoanType.setAlignmentX(0.0F);
        tblLoanType.setAlignmentY(0.0F);
        tblLoanType.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                tblLoanTypeMousePressed(evt);
            }
        });
        jScrollPane1.setViewportView(tblLoanType);

        javax.swing.GroupLayout pnlTableLayout = new javax.swing.GroupLayout(pnlTable);
        pnlTable.setLayout(pnlTableLayout);
        pnlTableLayout.setHorizontalGroup(
            pnlTableLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlTableLayout.createSequentialGroup()
                .addGap(26, 26, 26)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 758, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        pnlTableLayout.setVerticalGroup(
            pnlTableLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlTableLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 205, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pnlControl.setAlignmentX(0.0F);
        pnlControl.setAlignmentY(0.0F);
        pnlControl.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        pnlControl.setMinimumSize(new java.awt.Dimension(810, 35));
        pnlControl.setPreferredSize(new java.awt.Dimension(824, 35));

        btnlist.setFont(new java.awt.Font("Tahoma", 0, 12));
        btnlist.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/list1.png"))); // NOI18N
        btnlist.setText("List");
        btnlist.setAlignmentY(0.0F);
        btnlist.setPreferredSize(new java.awt.Dimension(70, 25));
        btnlist.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnlistActionPerformed(evt);
            }
        });
        pnlControl.add(btnlist);

        txtSearch.setAlignmentX(0.0F);
        txtSearch.setAlignmentY(0.0F);
        txtSearch.setMinimumSize(new java.awt.Dimension(100, 20));
        txtSearch.setPreferredSize(new java.awt.Dimension(120, 25));
        txtSearch.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtSearchActionPerformed(evt);
            }
        });
        pnlControl.add(txtSearch);

        cboSearch.setFont(new java.awt.Font("Tahoma", 0, 12));
        cboSearch.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Search by ID", "Search by type" }));
        cboSearch.setAlignmentX(0.0F);
        cboSearch.setAlignmentY(0.0F);
        cboSearch.setPreferredSize(new java.awt.Dimension(115, 25));
        cboSearch.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cboSearchActionPerformed(evt);
            }
        });
        pnlControl.add(cboSearch);

        btnSearch.setFont(new java.awt.Font("Tahoma", 0, 12));
        btnSearch.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icon/xmag.png"))); // NOI18N
        btnSearch.setText("Search");
        btnSearch.setAlignmentY(0.0F);
        btnSearch.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSearchActionPerformed(evt);
            }
        });
        pnlControl.add(btnSearch);

        btnDisable.setFont(new java.awt.Font("Tahoma", 0, 12));
        btnDisable.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/_lock.png"))); // NOI18N
        btnDisable.setText("Disable");
        btnDisable.setAlignmentY(0.0F);
        btnDisable.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDisableActionPerformed(evt);
            }
        });
        pnlControl.add(btnDisable);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(pnlTable, javax.swing.GroupLayout.PREFERRED_SIZE, 794, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(pnlForm, javax.swing.GroupLayout.Alignment.LEADING, 0, 788, Short.MAX_VALUE)
                        .addComponent(pnlControl, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 788, Short.MAX_VALUE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(pnlForm, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pnlControl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(pnlTable, javax.swing.GroupLayout.PREFERRED_SIZE, 227, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(56, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    public void loadLoanType() {
        try {
            loanTypes = blLoanType.getAll();
        } catch (Exception e) {
        }
        loaddata();
        btnEdit.setEnabled(false);
        btnDisable.setEnabled(false);
        btnAdd.setEnabled(false);
    }

    public void loaddata() {
        DefaultTableModel mode = new DefaultTableModel();
        mode.addColumn("ID");
        mode.addColumn("Type Of Loan");
        mode.addColumn("Interest Rate");
        mode.addColumn("Status");

        mode.setRowCount(loanTypes.size());
        int i = 0;
        for (LoanType n : loanTypes) {
            mode.setValueAt(n.getLoanTypeID(), i, 0);
            mode.setValueAt(n.getTypeOfLoan(), i, 1);
            mode.setValueAt(n.getInterestRate(), i, 2);
            if(n.isStatus()){
                mode.setValueAt("Available", i, 3);
            }else{
                mode.setValueAt("Not Available", i, 3);
            }
            i++;
        }
        this.tblLoanType.setModel(mode);
    }
private void btnlistActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnlistActionPerformed
// TODO add your handling code here:
    loadLoanType();
    btnEdit.setEnabled(false);
    btnDisable.setEnabled(false);
    btnAdd.setEnabled(false);
}//GEN-LAST:event_btnlistActionPerformed

private void cboSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cboSearchActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_cboSearchActionPerformed

private void btnSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSearchActionPerformed
// TODO add your handling code here:
    int select = cboSearch.getSelectedIndex();
    String search = txtSearch.getText();
    try {
        switch (select) {
            case 0:
                loanTypes = blLoanType.getByID(search);
                break;
            case 1:
                loanTypes = blLoanType.getByName(search);
                break;
            default:
                break;
        }

        if (loanTypes.size() == 0) {
            JOptionPane.showMessageDialog(pnlControl, Localization.getMessage("NotFound"), "Information", JOptionPane.INFORMATION_MESSAGE);
            loanTypes = blLoanType.getAll();
        }
        loaddata();
    } catch (Exception e) {
    }
}//GEN-LAST:event_btnSearchActionPerformed

private void btnAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddActionPerformed
// TODO add your handling code here:
    String typeOfLoan = txtTypeOfLoan.getText();
    String interestRate = txtInterestRate.getText();
    try {
        if (blLoanType.insert(typeOfLoan, interestRate)) {
            loadLoanType();
            lblLoanTypeID.setText("");
            txtTypeOfLoan.setText("");
            txtInterestRate.setText("");
        }
    } catch (Exception ex) {
    }


}//GEN-LAST:event_btnAddActionPerformed

private void btnEditActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditActionPerformed
// TODO add your handling code here:
    String id = lblLoanTypeID.getText();
    String typeOfLoan = txtTypeOfLoan.getText();
    String interestRate = txtInterestRate.getText();
    try {
        if (blLoanType.update(id, typeOfLoan, interestRate)) {
            loadLoanType();
            this.btnDisable.setEnabled(true);
            this.btnEdit.setEnabled(true);
        }
    } catch (Exception ex) {
    }
}//GEN-LAST:event_btnEditActionPerformed

private void btnDisableActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDisableActionPerformed
// TODO add your handling code here:
    String di = "";
    if (loanType.isStatus()) {
        di = "Are you sure you want to disable ?";
    } else {
        di = "Are you sure you want to enable ?";
    }
    int select = JOptionPane.showConfirmDialog(pnlControl, di, "Disable/Enable Loan type", JOptionPane.OK_OPTION);
    if (select == 0) {

        String id = lblLoanTypeID.getText();

        try {
            if (loanType.isStatus()) {
                blLoanType.disable(Integer.parseInt(id));
            } else {
                blLoanType.enable(Integer.parseInt(id));
            }
            loadLoanType();

        } catch (Exception ex) {
        }
    }
}//GEN-LAST:event_btnDisableActionPerformed

private void btnNewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNewActionPerformed
// TODO add your handling code here:
    lblLoanTypeID.setText("");
    txtInterestRate.setText("");
    txtTypeOfLoan.setText("");
    btnAdd.setEnabled(true);
    btnEdit.setEnabled(false);
    btnDisable.setEnabled(false);

}//GEN-LAST:event_btnNewActionPerformed

private void tblLoanTypeMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblLoanTypeMousePressed
// TODO add your handling code here:
    int row = this.tblLoanType.getSelectedRow();
    loanType = loanTypes.get(row);
    lblLoanTypeID.setText(String.valueOf(loanType.getLoanTypeID()));
    txtTypeOfLoan.setText(loanType.getTypeOfLoan());
    txtInterestRate.setText(String.valueOf(loanType.getInterestRate()));
    if (loanType.isStatus()) {
        this.btnDisable.setEnabled(true);
        this.btnDisable.setText("Disable");
    } else {
        this.btnDisable.setEnabled(true);
        this.btnDisable.setText("Enable");
    }
    this.btnEdit.setEnabled(true);

}//GEN-LAST:event_tblLoanTypeMousePressed

private void txtSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtSearchActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_txtSearchActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAdd;
    private javax.swing.JButton btnDisable;
    private javax.swing.JButton btnEdit;
    private javax.swing.JButton btnNew;
    private javax.swing.JButton btnSearch;
    private javax.swing.JButton btnlist;
    private javax.swing.JComboBox cboSearch;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel lblLoanTypeID;
    private javax.swing.JPanel pnlControl;
    private javax.swing.JPanel pnlForm;
    private javax.swing.JPanel pnlTable;
    private javax.swing.JTable tblLoanType;
    private javax.swing.JTextField txtInterestRate;
    private javax.swing.JTextField txtSearch;
    private javax.swing.JTextField txtTypeOfLoan;
    // End of variables declaration//GEN-END:variables
}
